package com.hzncc.flowable_diboot.contract.vo;

import com.diboot.core.binding.annotation.BindEntityList;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.vo.FileVO;
import com.diboot.file.entity.FileRecord;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.contract.entity.ContractProduct;
import com.hzncc.flowable_diboot.contract.entity.ContractProductMaterial;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
* 合同产品信息 VO定义
* @author MyName
* @version 1.0
* @date 2024-07-12
* Copyright © MyCorp
*/
@Getter @Setter @Accessors(chain = true)
public class ContractProductListVO extends ContractProduct  {
private static final long serialVersionUID = 1741854867903273386L;
    /**
    * 创建人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.create_by = id"
     )
    private String createByLabel;

    /**
    * 更新人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.update_by = id"
     )
    private String updateByLabel;

    @BindEntityList(
            entity = ContractProductMaterial.class,
            condition = "this.id = contract_product_id",
            deepBind = true
    )
    private List<ContractProductMaterialVO> contractProductMaterialVOList;

    /**
     * 技术清单文件
     */
    @BindEntityList(entity = FileRecord.class, condition = "this.techFile = id", splitBy = ",")
    private List<FileVO> techFiles;

    private String productDesc;

    /**
     * 销售目录价
     */
    private String listPrice;
}